Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tidy up in the release manifest generation script #147

Merged
merged 5 commits into from
May 22, 2024

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented May 21, 2024

Proposed Changes

Today, I looked at the manifest script as the base for a similar functionality in another app. I noticed a minor error in the documentation and a few opportunities to improve the maintainability.

Testing Instructions

Run node ./scripts/generate-releases-manifest.mjs and ensure out/releases.json is modified as expected.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? – N.A.

The idea being that it's more compact this way, rather than defining a
reusable value that is only ever used once.
@mokagio mokagio requested review from p-jackson and wojtekn May 21, 2024 06:14
Comment on lines 17 to 18
// "x64": {
// "sha": "abcdef1234567890",
// "url": "https://cdn.a8c-ci.services/studio/studio-win32-x64-abcdef1234567890.exe.zip"
// }
// "sha": "abcdef1234567890",
// "url": "https://cdn.a8c-ci.services/studio/studio-win32-x64-abcdef1234567890.exe.zip"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no additional architecture sub-level for the Windows builds.

Comment on lines -138 to +140
const releaseVersionZipFilenameMac = `https://cdn.a8c-ci.services/studio/studio-darwin-v${ version }.app.zip`;
const releaseVersionZipFilenameX64 = `https://cdn.a8c-ci.services/studio/studio-darwin-x64-v${ version }.app.zip`;
const releaseVersionZipFilenameArm64 = `https://cdn.a8c-ci.services/studio/studio-darwin-arm64-v${ version }.app.zip`;
const releaseVersionZipFilenameWin32 = `https://cdn.a8c-ci.services/studio/studio-win32-v${ version }.exe`;

releasesData[ version ] = releasesData[ version ] ?? {};

// macOS
releasesData[ version ][ 'darwin' ] = releasesData[ version ][ 'darwin' ] ?? {};
releasesData[ version ][ 'darwin' ][ 'universal' ] = {
sha: currentCommit,
url: releaseVersionZipFilenameMac,
url: `${ cdnURL }/${ baseName }-darwin-v${ version }.app.zip`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personal take: It's cleaner to inline these URL definitions since they are only ever used once.

// "url": "https://cdn.a8c-ci.services/studio/studio-win32-x64-abcdef1234567890.exe.zip"
// }
// "sha": "abcdef1234567890",
// "url": "https://cdn.a8c-ci.services/studio/studio-win32-abcdef1234567890.exe.zip"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for fixing the example according the implementation.

I've added https://github.com/Automattic/dotcom-forge/issues/7317 to add support for Windows in the updates endpoint.

@wojtekn wojtekn merged commit 9b5d947 into trunk May 22, 2024
11 checks passed
@wojtekn wojtekn deleted the mokagio/manifest-tidy-ups branch May 22, 2024 10:19
@mokagio mokagio changed the title Fix sample for win32 entry in manifest script Minor tidy up in the release manifest generation script Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants